package cn.xiehang.SoundSight;

import java.util.List;

public class Order {
    private String orderId;
    private List<Product> products;
    private String orderStatus;
    private String orderCreateTime;
    private float totalPrice;
    private float rating;

    public Order(String orderId, List<Product> products, String orderStatus, String orderCreateTime, float totalPrice) {
        this.orderId = orderId;
        this.products = products;
        this.orderStatus = orderStatus;
        this.orderCreateTime = orderCreateTime;
        this.totalPrice = totalPrice;
    }
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public List<Product> getProducts() {
        return products;
    }
    public void setProducts(List<Product> products) {
        this.products = products;
    }
    public float getRating() {
        return rating;
    }
    public void setRating(float rating) {
        this.rating = rating;
    }
    public String getOrderStatus() {
        return orderStatus;
    }
    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }
    public String getOrderCreateTime() {
        return orderCreateTime;
    }
    public void setOrderCreateTime(String orderCreateTime) {
        this.orderCreateTime = orderCreateTime;
    }
    public float getTotalPrice() {
        return totalPrice;
    }
    //获取Product列表中第一个商品的imageUrl
    public Object getProductImageUrl() {
        if (products != null && !products.isEmpty()) {
            return products.get(0).getImageUrl();
        }
        return null;
    }
}
